# 跳出语句

"""
continue: 跳出本次循环，后面的语句不执行，继续下一次的循环
break: 跳出循环结构
"""
# 打印 1到100: 超过50不打印，3的倍数不打印
for i in range(100):
    if i > 50:
        break
    if (i % 3) == 0:
        continue
    print("------>", i)

print("###" * 20)
"""
循环嵌套问题：
    if 条件：
        if 条件：
            pass
    else:
        if 条件：
            pass
            
while: 循环嵌套
    *
    **
    ***
    ****
    *****
"""
# while 循环嵌套（打印矩形、和递归星型）
i = 1
while True:
    print("*" * i)
    if i > 5:
        break
    i += 1

# 5*5的矩形
i = 1
while True:
    print("*" * 5)
    i += 1
    if i > 5:
        break
print("###" * 30)
# 嵌套打印
line = 1
while line <= 5:
    column = 0
    while column < line:
        print("*", end="")
        # 控制跳出
        column += 1
    # 控制跳出
    line += 1
    print()

print("888" * 30)
'''
倒星打印
*****
****
***
**
*
'''
line = 1
while line <= 5:
    column = 5
    while line <= column:
        print("*", end="")
        column -= 1
    line += 1
    print()
